import { API, PageParam } from '@/services/model/baseModel';
import config from '@/utils/config';
import { request } from '@/utils/http';
import { CoinModel, SignModel } from '@/services/model/coinModel';

/**
 * 获取积分数量
 * @returns res
 */
const getCoinCount = () => {
  return request.get<API<string>>(config.url.coin_num);
};

/**
 * 获取积分明细
 * @returns res
 */
const getCoinList = (pageParam: PageParam) => {
  return request.post<API<Array<CoinModel>>>(config.url.coin_list, pageParam);
};

/**
 * 获取签到数据
 * @returns res
 */
const getSignData = () => {
  return request.get<API<SignModel>>(config.url.coin_sign);
};

const saveSignData = () => {
  return request.get<API<SignModel>>(config.url.coin_sign_save);
};

export { getCoinCount, getCoinList, getSignData, saveSignData };
